<?php

declare(strict_types=1);

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Influencer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;

class InfluencerController extends Controller
{
    /**
     * 获取网红评分
     */
    public function score(Request $request, Influencer $influencer): JsonResponse
    {
        return response()->json([
            'success' => true,
            'data' => [
                'score' => $influencer->score,
                'report_count' => $influencer->report_count,
                'is_blacklisted' => $influencer->is_blacklisted,
            ]
        ]);
    }

    /**
     * 获取网红历史举报记录
     */
    public function reports(Request $request, Influencer $influencer): JsonResponse
    {
        $reports = $influencer->reports()
            ->with('user:id,name')
            ->latest()
            ->paginate(15);

        return response()->json([
            'success' => true,
            'data' => $reports
        ]);
    }
} 